﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BookSystem
{
    public partial class AddUsersForm : Form
    {
        public AddUsersForm()
        {
            InitializeComponent();
        }

        private void AddUsersForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void but_queren_Click(object sender, EventArgs e)
        {
            string name = this.Box_name.Text;
            string pswd = this.Box_pswd.Text;

            string sql = string.Format("insert into T_Users (Name,pswd) values ('{0}','{1}')", name, pswd);
            if (DBHepler.SqlCommand(sql)>0)
            {
                Type.name = this.Box_name.Text;

                MainForm MainForm = new MainForm();
                MainForm.Show();
                this.Hide();
            }
        }

        private void lLab_login_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            LoginMainForm LoginMainForm = new LoginMainForm();
            LoginMainForm.Show();
            this.Hide();
        }
    }
}
